/*
 * Copyright 2016-2018 TVI Go Easy.
 * Created on 2018/1/29 16:57
 */
package com.tvi.cloud.license.client;

import com.tvi.cloud.license.model.Organization;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

/**
 * 请在此写下该类的说明
 *
 * @author mechanic
 */
@Component
public class OrganizationRibbonClent {
    @Autowired
    private RestTemplate restTemplate;

    public Organization getOrganization(String organizationId){
        ResponseEntity<Organization> restExchange =
                restTemplate.exchange(
                        "http://organization-service/v1/organization/{organizationId}",
                        HttpMethod.GET,
                        null, Organization.class, organizationId);

        return restExchange.getBody();
    }
}
